﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" MasterPageFile="~/MasterPage.master" Inherits="admin_Default" %>
<%@ MasterType virtualpath="~/MasterPage.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div>
        <ul>
            <li>Create an event <asp:HyperLink ID="HyperLink1" NavigateUrl="~/admin/ManageEvent.aspx" runat="server">here</asp:HyperLink></li>
            <li>View upcoming events <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/UpcomingEvents.aspx">here</asp:HyperLink></li>
            <li>Give administrator rights to users <asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="~/admin/PromoteUser.aspx">here</asp:HyperLink></li>
            <li>Manage skills and their categories
                <asp:HyperLink ID="HyperLink4" runat="server" 
                    NavigateUrl="~/admin/ManageSkills.aspx">here</asp:HyperLink>
            </li>
        </ul>
    </div>

    <asp:Label ID="Label1" runat="server" Text="Choose View to Manage"></asp:Label>
    <asp:RadioButtonList ID="RadioButtonListViews" RepeatDirection="Horizontal" 
        runat="server" AutoPostBack="True" 
        onselectedindexchanged="RadioButtonListViews_SelectedIndexChanged">
        <asp:ListItem Text="Neighborhoods" Selected="True" Value="0"></asp:ListItem>
        <asp:ListItem Text="Sponsor Organizations" Value="1"></asp:ListItem>
        <asp:ListItem Text="Volunteer Groups" Value="2"></asp:ListItem>
    </asp:RadioButtonList>
    
    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
        <asp:View ID="ViewNeighborhoods" runat="server">
            <i>
                <asp:Literal ID="Literal1" runat="server" Text="Add group headings for events"></asp:Literal></i>
            <asp:ListView ID="ListView2" runat="server" DataKeyNames="neighborhood_id" DataSourceID="DSHoods"
                InsertItemPosition="LastItem">
                <ItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                        </td>
                        <td>
                            <asp:Label ID="neighborhoodLabel" runat="server" Text='<%# Eval("neighborhood") %>' />
                        </td>
                    </tr>
                </ItemTemplate>
                <AlternatingItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                        </td>
                        <td>
                            <asp:Label ID="neighborhoodLabel" runat="server" Text='<%# Eval("neighborhood") %>' />
                        </td>
                    </tr>
                </AlternatingItemTemplate>
                <EmptyDataTemplate>
                    <table id="Table1" runat="server" style="">
                        <tr>
                            <td>
                                No data was returned.
                            </td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
                <InsertItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
                        </td>
                        <td>
                            <asp:TextBox ID="neighborhoodTextBox" runat="server" Text='<%# Bind("neighborhood") %>' />
                        </td>
                    </tr>
                </InsertItemTemplate>
                <LayoutTemplate>
                    <table id="Table2" runat="server">
                        <tr id="Tr1" runat="server">
                            <td id="Td1" runat="server">
                                <table id="itemPlaceholderContainer" runat="server" border="0" style="">
                                    <tr id="Tr2" runat="server" style="">
                                        <th id="Th1" runat="server">
                                        </th>
                                        <th id="Th2" runat="server">
                                            Neighborhood
                                        </th>
                                    </tr>
                                    <tr id="itemPlaceholder" runat="server">
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr id="Tr3" runat="server">
                            <td id="Td2" runat="server" style="">
                            </td>
                        </tr>
                    </table>
                </LayoutTemplate>
                <EditItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                        </td>
                        <td>
                            <td>
                                <asp:TextBox ID="neighborhoodTextBox" runat="server" Text='<%# Bind("neighborhood") %>' />
                            </td>
                    </tr>
                </EditItemTemplate>
                <SelectedItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                        </td>
                        <td>
                            <asp:Label ID="neighborhoodLabel" runat="server" Text='<%# Eval("neighborhood") %>' />
                        </td>
                    </tr>
                </SelectedItemTemplate>
            </asp:ListView>
        </asp:View>
        <asp:View ID="ViewOrgs" runat="server">
            <i>
                <asp:Literal ID="Literal2" runat="server" Text="Add organizations that sponsor events"></asp:Literal></i>
            <asp:ListView ID="ListView1" runat="server" DataKeyNames="organization_id" DataSourceID="DSOrgs"
                InsertItemPosition="LastItem">
                <ItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                        </td>
                        <td>
                            <asp:Label ID="organizationLabel" runat="server" Text='<%# Eval("organization") %>' />
                        </td>
                        <td>
                            <asp:CheckBox ID="isActiveCheckBox" runat="server" Checked='<%# Eval("isActive") %>'
                                Enabled="false" />
                        </td>
                    </tr>
                </ItemTemplate>
                <AlternatingItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                        </td>
                        <td>
                            <asp:Label ID="organizationLabel" runat="server" Text='<%# Eval("organization") %>' />
                        </td>
                        <td>
                            <asp:CheckBox ID="isActiveCheckBox" runat="server" Checked='<%# Eval("isActive") %>'
                                Enabled="false" />
                        </td>
                    </tr>
                </AlternatingItemTemplate>
                <EmptyDataTemplate>
                    <table id="Table3" runat="server" style="">
                        <tr>
                            <td>
                                No data was returned.
                            </td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
                <InsertItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            <asp:TextBox ID="organizationTextBox" runat="server" Text='<%# Bind("organization") %>' />
                        </td>
                        <td>
                            <asp:CheckBox ID="isActiveCheckBox" runat="server" Checked="true" />
                        </td>
                    </tr>
                </InsertItemTemplate>
                <LayoutTemplate>
                    <table id="Table4" runat="server">
                        <tr id="Tr4" runat="server">
                            <td id="Td3" runat="server">
                                <table id="itemPlaceholderContainer" runat="server" border="0" style="">
                                    <tr id="Tr5" runat="server" style="">
                                        <th id="Th3" runat="server">
                                        </th>
                                        <th id="Th4" runat="server">
                                            Organization
                                        </th>
                                        <th id="Th5" runat="server">
                                            Active?
                                        </th>
                                    </tr>
                                    <tr id="itemPlaceholder" runat="server">
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr id="Tr6" runat="server">
                            <td id="Td4" runat="server" style="">
                                <asp:DataPager ID="DataPager1" runat="server">
                                    <Fields>
                                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" />
                                    </Fields>
                                </asp:DataPager>
                            </td>
                        </tr>
                    </table>
                </LayoutTemplate>
                <EditItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                        </td>
                        <td>
                            <asp:TextBox ID="organizationTextBox" runat="server" Text='<%# Bind("organization") %>' />
                        </td>
                        <td>
                            <asp:CheckBox ID="isActiveCheckBox" runat="server" Checked='<%# Bind("isActive") %>' />
                        </td>
                    </tr>
                </EditItemTemplate>
                <SelectedItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                        </td>
                        <td>
                            <asp:Label ID="organizationLabel" runat="server" Text='<%# Eval("organization") %>' />
                        </td>
                        <td>
                            <asp:CheckBox ID="isActiveCheckBox" runat="server" Checked='<%# Eval("isActive") %>'
                                Enabled="false" />
                        </td>
                    </tr>
                </SelectedItemTemplate>
            </asp:ListView>
        </asp:View>
        <asp:View ID="ViewGroups" runat="server">
            <i>
                <asp:Literal ID="Literal3" runat="server" Text="Add groups to which volunteers belong"></asp:Literal></i>
            <asp:ListView ID="ListView3" runat="server" DataKeyNames="group_id" DataSourceID="DSGroups"
                InsertItemPosition="LastItem">
                <ItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                        </td>
                        <td>
                            <asp:Label ID="groupLabel" runat="server" Text='<%# Eval("groupName") %>' />
                        </td>
                    </tr>
                </ItemTemplate>
                <AlternatingItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                        </td>
                        <td>
                            <asp:Label ID="groupLabel" runat="server" Text='<%# Eval("groupName") %>' />
                        </td>
                    </tr>
                </AlternatingItemTemplate>
                <EmptyDataTemplate>
                    <table id="Table3" runat="server" style="">
                        <tr>
                            <td>
                                No data was returned.
                            </td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
                <InsertItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            <asp:TextBox ID="groupTextBox" runat="server" Text='<%# Bind("groupName") %>' />
                        </td>
                    </tr>
                </InsertItemTemplate>
                <LayoutTemplate>
                    <table id="Table4" runat="server">
                        <tr id="Tr4" runat="server">
                            <td id="Td3" runat="server">
                                <table id="itemPlaceholderContainer" runat="server" border="0" style="">
                                    <tr id="Tr5" runat="server" style="">
                                        <th id="Th3" runat="server">
                                        </th>
                                        <th id="Th4" runat="server">
                                            Group
                                        </th>
                                    </tr>
                                    <tr id="itemPlaceholder" runat="server">
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr id="Tr6" runat="server">
                            <td id="Td4" runat="server" style="">
                                <asp:DataPager ID="DataPager1" runat="server">
                                    <Fields>
                                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" />
                                    </Fields>
                                </asp:DataPager>
                            </td>
                        </tr>
                    </table>
                </LayoutTemplate>
                <EditItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                        </td>
                        <td>
                            <asp:TextBox ID="groupTextBox" runat="server" Text='<%# Bind("groupName") %>' />
                        </td>
                    </tr>
                </EditItemTemplate>
                <SelectedItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                        </td>
                        <td>
                            <asp:Label ID="organizationLabel" runat="server" Text='<%# Eval("groupName") %>' />
                        </td>
                    </tr>
                </SelectedItemTemplate>
            </asp:ListView>
        </asp:View>
    </asp:MultiView>

    <asp:LinqDataSource ID="DSHoods" runat="server" 
        ContextTypeName="OpenGivingDataContext" EnableDelete="True" 
        EnableInsert="True" EnableUpdate="True" OrderBy="neighborhood" 
        TableName="Neighborhoods">
    </asp:LinqDataSource>
    <asp:LinqDataSource ID="DSOrgs" runat="server" 
        ContextTypeName="OpenGivingDataContext" EnableDelete="True" 
        EnableInsert="True" EnableUpdate="True" OrderBy="organization" 
        TableName="Organizations">
    </asp:LinqDataSource>
    <asp:LinqDataSource ID="DSGroups" runat="server" 
        ContextTypeName="OpenGivingDataContext" EnableDelete="True" 
        EnableInsert="True" EnableUpdate="True" OrderBy="groupName" 
        TableName="Groups">
    </asp:LinqDataSource>
</asp:Content>
